package com.meila.cms.services.impl;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;

import com.meila.cms.dao.CarDesignMapper;
import com.meila.cms.dao.CarInstructionsMapper;
import com.meila.cms.dao.CarMapper;
import com.meila.cms.dao.DictMapper;
import com.meila.cms.dao.PartListDesignMapper;
import com.meila.cms.dao.RoleMapper;
import com.meila.cms.dao.UserMapper;
import com.meila.cms.dao.UserRoleMapper;
import com.meila.cms.entity.User;
import com.meila.cms.model.UserModel;
import com.meila.cms.util.DictUtil;

public class BaseService {
 
    @Autowired
    protected DataSourceTransactionManager transactionManager;  
    
	@Autowired
	protected  HttpSession session;
	
	@Autowired
	protected CarInstructionsMapper carInstructionsMapper;
	
	@Autowired
	protected PartListDesignMapper partListDesignMapper;
	
    @Autowired
	protected CarDesignMapper carDesignMapper;
	
    @Autowired
    protected CarMapper carMapper;
    
    @Autowired
    protected UserMapper userMapper;
    
    @Autowired
    protected UserRoleMapper userRoleMapper;
    
    @Autowired
    protected RoleMapper roleMapper;
    
    @Autowired
    protected DictMapper dictMapper;
	
    @Autowired
    protected DictUtil dictUtil;
    
 
	public   UserModel getLoginUser() {
	 
		UserModel user=(UserModel) session.getAttribute("loginUser");
		
		if(user==null){
			user =	new UserModel();
		}
		
		return user;
	}

}
